package com.duan.controller;

import com.duan.pojo.SysUser;
import com.duan.service.LoginService;
import com.duan.utils.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author db
 * @version 1.0
 * @description LoginController
 * @since 2024/9/24
 */
@RestController
public class LoginController {
    @Autowired
    private LoginService loginService;

    @PostMapping("/user/login")
    public ResponseResult login(@RequestBody SysUser sysUser){
        String jwt = loginService.login(sysUser);
        return ResponseResult.okResult(jwt);
    }
}
